<?php if( ($iNodeId) && ($iParentId) ): ?>
  <script type="text/javascript">
    $(document).ready(function(){
       if (!($("#main_menu_delete").hasClass("show_active")))
       {
         $(".node_delete").hide();
       }

       if ($("#main_menu_move").hasClass("push_active"))
       {
         $(".node_move_push").show();
         $(".node_move_put").hide();
         $("#main_menu_move").addClass("push_active");
       }
       else
       {
         $(".node_move_push").hide();
         $(".node_move_put").show();
       }

       if (!($("#main_menu_move").hasClass("show_active")))
       {
         $(".node_move_push").hide();
         $(".node_move_put").hide();
       }
       //to function delete
       $("#<?php echo 'delete_'.$iNodeId; ?>").click(function() {
        $("#<?php echo 'delete_'.$iNodeId; ?>").parent().hide();
        $("#ca_pnsm_message_panel").load("<?php echo url_for('ca_delete_node',array('node_id' => $iNodeId )); ?>");
       });

       //to function move
       $("#<?php echo 'move_push_'.$iNodeId; ?>").click(function() {
        $("#ca_pnsm_message_panel").load("<?php echo url_for('ca_push_node',array('node_id' => $iNodeId )); ?>");
        $("#<?php echo 'node_'.$iNodeId; ?>").parent().hide();
        $(".node_move_push").hide();
        $(".node_move_put").show();
        $("#main_menu_move").removeClass("push_active");
       });

       $("#<?php echo 'move_put_before_'.$iNodeId; ?>").click(function() {
        $("#ca_pnsm_message_panel").load("<?php echo url_for('ca_put_before_node',array('node_id' => $iNodeId )); ?>");
           $("#<?php echo 'move_put_before_'.$iNodeId; ?>").ajaxStop(function() {
            $("#main_menu_move").addClass("push_active");
            $(".node_move_push").show();
            $(".node_move_put").hide();
            $("#<?php echo 'node_children_'.$iParentId; ?>").load("<?php echo url_for('ca_get_tree',array('node_id' =>  $iParentId )); ?>");
           });
        });
        
       $("#<?php echo 'move_put_after_'.$iNodeId; ?>").click(function() {
        $("#ca_pnsm_message_panel").load("<?php echo url_for('ca_put_after_node',array('node_id' => $iNodeId )); ?>");
          $("#<?php echo 'move_put_before_'.$iNodeId; ?>").ajaxStop(function() {
            $("#main_menu_move").addClass("push_active");
            $(".node_move_push").show();
            $(".node_move_put").hide();
            $("#<?php echo 'node_children_'.$iParentId; ?>").load("<?php echo url_for('ca_get_tree',array('node_id' =>  $iParentId )); ?>");
          });
       });


    });
  </script>

  <?php echo  image_tag('/caPropelTreePlugin/css/images/page_delete.png',array('id' => 'delete_'.$iNodeId,'class' => 'node_delete action', 'alt' => 'delete', 'absolute' => true)); ?>
  <?php echo  image_tag('/caPropelTreePlugin/css/add/push.png',array('id' => 'move_push_'.$iNodeId, 'class' => 'node_move_push action', 'alt' => 'move_push', 'absolute' => true)); ?>
  <?php if($sf_user->getAttribute('iPushNodeId',false) != $iNodeId): ?>
    <?php echo   image_tag('/caPropelTreePlugin/css/add/put_after.png',array('id' =>'move_put_after_'.$iNodeId, 'class' => 'node_move_put action', 'alt' => 'move_put_after', 'absolute' => true)); ?>
    <?php echo   image_tag('/caPropelTreePlugin/css/add/put_before.png',array('id' =>'move_put_before_'.$iNodeId, 'class' => 'node_move_put action', 'alt' => 'move_put_before', 'absolute' => true)); ?>
  <?php endif; ?>

<?php endif; ?>
  